//
//  LGChartMessageTableViewCell.m
//  ligenyun
//
//  Created by Mac on 2018/3/24.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "LGChartMessageTableViewCell.h"

@interface  LGChartMessageTableViewCell()
@property(nonatomic, strong) STButton                     *iconButton;
@property(nonatomic, strong) STLabel                     *nameLable;
@property(nonatomic, strong) STLabel                     *timeLable;
@property(nonatomic, strong) STLabel                     *contentLable;
@end
@implementation LGChartMessageTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 100;
}
#pragma mark --subView
- (void)configSubView{
    self.iconButton = [[STButton alloc] initWithFrame:CGRectMake(15, 10, 66, 66)
                                                title:nil
                                           titleColor:nil
                                            titleFont:0
                                         cornerRadius:33
                                      backgroundColor:nil
                                      backgroundImage:[UIImage imageNamed:@"1"]
                                                image:nil];
    self.iconButton.centerY = [LGChartMessageTableViewCell cellHeight]/2;
    [self addSubview:self.iconButton];
    
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right + 33,self.iconButton.top + 15, 100, 20)
                                                     text:@"stoneobs"
                                                textColor:FirstTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    self.nameLable = titleLable;
    [NSString lableAutoAdjustheightWithLabel:titleLable];
    [self addSubview:self.nameLable];
    

    
    NSDate * date = [NSDate st_localCurrentDate];
    STLabel * timeLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right+10,titleLable.top, 50, 20)
                                                    text:date.st_dynamicFormater
                                               textColor:SecendTextColor
                                                    font:11
                                             isSizetoFit:NO
                                           textAlignment:NSTextAlignmentRight];
    self.timeLable = timeLable;
    timeLable.right = UIScreenWidth - 24;
    [self addSubview:self.timeLable];
    
    STLabel * contentLable = [[STLabel alloc] initWithFrame:CGRectMake(self.nameLable.left,self.nameLable.bottom + 10, timeLable.right - titleLable.left, 20)
                                                     text:@"的撒考虑到金坷垃手机登录撒娇达拉斯经典款拉四季度"
                                                textColor:SecendTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    self.contentLable = contentLable;
    [NSString lableAutoAdjustheightWithLabel:titleLable];
    [self addSubview:self.contentLable];
}

@end
